package com.lxy.aimin.auth.controller;


import com.lxy.aimin.auth.entity.User;
import com.lxy.aimin.auth.mapper.UserMapper;
import com.lxy.aimin.auth.response.Result;
import com.lxy.aimin.auth.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {


    @Autowired
    private UserService userService;

    @GetMapping
    public Result<?> getAll() {
        String string = userService.list().toString();
        return Result.success(string);
    }


    @GetMapping("/deep")
    public Result<?> getDeep() {
        User byIdDeep = userService.getByIdDeep(2);
        return Result.success(byIdDeep);
    }
}
